﻿using NPOI.HSSF.Record.PivotTable;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using 基于WPF的电缆采样数据分析系统.ViewModels.TDRWork;
using 基于WPF的电缆采样数据分析系统.Views.TDRWork.OptionPage;

namespace 基于WPF的电缆采样数据分析系统.Views.TDRWork
{
    /// <summary>
    /// OptionUC.xaml 的交互逻辑
    /// </summary>
    public partial class OptionUC : UserControl
    {
        public OptionUC()
        {
            InitializeComponent();
            this.DataContext = OptionUCViewModel.Instance;
            InitOption();
        }

        /// <summary>
        /// 初始化按钮样式和默认选中项
        /// </summary>
        private void InitOption()
        {
            LangugeEdit.Visibility = Visibility.Visible;
            SubjectEdit.Visibility = Visibility.Collapsed;
            DefaultParameterEdit.Visibility = Visibility.Collapsed;
            LangugeBtnSelectedStyle();
        }

        /// <summary>
        /// 默认选中语言设置，按钮样式配置
        /// </summary>
        private void LangugeBtnSelectedStyle()
        {
            LangugeBtn.BorderThickness = new Thickness(0, 0, 0, 4);
            SubjectBtn.BorderThickness = new Thickness(0);
            DefaultParameterBtn.BorderThickness = new Thickness(0);
        }

        /// <summary>
        /// 语言设置按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void LangugeBtn_Click(object sender, RoutedEventArgs e)
        {
            LangugeBtn.BorderThickness = new Thickness(0,0,0,4);
            SubjectBtn.BorderThickness = new Thickness(0);
            DefaultParameterBtn.BorderThickness = new Thickness(0);
            LangugeEdit.Visibility = Visibility.Visible;
            SubjectEdit.Visibility = Visibility.Collapsed;
            DefaultParameterEdit.Visibility = Visibility.Collapsed;
        }

        /// <summary>
        /// 主题设置按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SubjectBtn_Click(object sender, RoutedEventArgs e)
        {
            LangugeBtn.BorderThickness = new Thickness(0);
            SubjectBtn.BorderThickness = new Thickness(0, 0, 0, 4);
            DefaultParameterBtn.BorderThickness = new Thickness(0);
            LangugeEdit.Visibility = Visibility.Collapsed;
            SubjectEdit.Visibility = Visibility.Visible;
            DefaultParameterEdit.Visibility = Visibility.Collapsed;
        }

        /// <summary>
        /// 默认参数设置按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DefaultParameterBtn_Click(object sender, RoutedEventArgs e)
        {
            LangugeBtn.BorderThickness = new Thickness(0);
            SubjectBtn.BorderThickness = new Thickness(0);
            DefaultParameterBtn.BorderThickness = new Thickness(0, 0, 0, 4);
            LangugeEdit.Visibility = Visibility.Collapsed;
            SubjectEdit.Visibility = Visibility.Collapsed;
            DefaultParameterEdit.Visibility = Visibility.Visible;
        }
    }
}
